<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>水平滚动</title>
    <style>
        .inner-container {
            padding: 0;
            margin-left: 5px;
        }
        ul {
            overflow-x: scroll;
            overflow-y: auto;
            /* 这个解决IOS不顺滑的问题 */
            -webkit-overflow-scrolling: touch;
            width: auto;
            /* 解决inline-block 换行的问题 */
            white-space: nowrap;
            font-size: 0;
            box-sizing: border-box;
            /* 解决有滚动条的问题 */
            padding-bottom: 20px;
            margin-bottom: -20px;
            padding-left: 10px;
        }
        li {
            margin-top: 15px;
            margin-bottom: 15px;
            display: inline-block;
            float: none;
        }
    </style>
</head>
<body>
    <div class="out-container">
        <div class="inner-container">
            <ul>
                <li>1</li>
                <li>1</li>
                <li>1</li>
                <li>1</li>
                <li>1</li>
                <li>1</li>
                <li>1</li>
            </ul>
        </div>
    </div>
    <script>


    </script>
</body>
</html>
